package com.school.admin.mapper;

import com.school.admin.entity.MallMenuRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.school.admin.entity.vo.PurviewVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 菜单角色中间表 Mapper 接口
 * </p>
 *
 * @author sunpx
 * @since 2022-03-24
 */
public interface MallMenuRoleMapper extends BaseMapper<MallMenuRole> {


    @Select("select group_concat(role_id)\n" +
            "from mall_sys_role t1 inner join  mall_sys_role_user t2 on t2.role_id=t1.id\n" +
            "where user_id=#{userId} group by user_id;")
    String getByUserId(String userId);


    /**
     * @author      : sunpx
     * @desc        : 查询角色下底层菜单
     * @date        :  17:17:45
     * @params      : s
     * @return      : java.util.List<java.lang.String>
     */
    List<String> getFinallyModule(String id);
}
